<%--
  Created by IntelliJ IDEA.
  User: 边牧
  Date: 2023/1/4
  Time: 21:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page isELIgnored="false" contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


<html>
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>

<body>
<h1>${u.name}</h1>
<input type="button" value="新增" id="id_add"><br>
<hr>
<table border="1" cellspacing="0" width="800">
    <tr>
        <th>序号</th>
        <th>品牌名称</th>
        <th>企业名称</th>
        <th>排序</th>
        <th>品牌介绍</th>
        <th>状态</th>
        <th>操作</th>
    </tr>

<%--   varStatus这个参数是自动生成序号，1开始 --%>
    <c:forEach items="${bra}" var="brand" varStatus="p">
        <tr align="center">
                <%--<td>${brand.id}</td>--%>
            <td>${p.count}</td>
            <td>${brand.name}</td>
            <td>${brand.company}</td>
            <td>${brand.ordered}</td>
            <td>${brand.des}</td>
            <c:if test="${brand.status == 1}">
                <td>启用</td>
            </c:if>
            <c:if test="${brand.status == 0}">
                <td>禁用</td>
            </c:if>
            <td><a href="/web04_1_war/servletSelectID?id=${brand.id}">修改</a> <a href="/web04_1_war/servletDelete?id=${brand.id}">删除</a></td>
        </tr>
    </c:forEach>

</table>


<script>
    document.getElementById("id_add").onclick = function (){
        location.href = "/web04_1_war/add.jsp"

    }
</script>

</body>
</html>
